package com.eibus.applicationconnector.twitter;

public interface ITwitterMethod {

	/**
     * Called when the method object is being cleaned up (removed from the connector).
     *
     * @throws  ConfigException
     */
    public void cleanup()
                 throws Exception;

    /**
     * Called when the method object is loaded.
     *
     * @param   acConfig  Contains the FileConnector configuration.
     *
     * @return  If <code>false</code> the method is not added to the connector.
     *
     * @throws  ConfigException
     */
    public boolean initialize(ApplicationConfiguration acConfig)
                       throws Exception;

    /**
     * Called the the connector reset() method is called. The implementation can clean caches, if
     * needed.
     */
    public void onReset();

    /**
     * Called when a SOAP request needs to be processed.
     *
     * @param   req  Request context for this request.
     *
     * @return  Processing status enumeration value.
     *
     * @throws  FileException
     */
    public EResult process(ISoapRequestContext req)
                    throws Exception;

    /**
     * Returns method name. SOAP requests are mapped to these method using this name.
     *
     * @return  Method name.
     */
    public String getMethodName();

    /**
     * Enumeration for <code>process</code> method return values.
     *
     * @author  mpoyhone
     */
    public enum EResult
    {
        /**
         * SOAP request was processed successfully.
         */
        FINISHED,
        /**
         * SOAP request processing will continue in the background after the method returns.
         */
        BACKGROUND
    }
	
}
